From cb01e038ecb67586c72ed8c8b99d9620d84a1ccb Mon Sep 17 00:00:00 2001 From: Chris Swindle Date: Wed, 1 Nov 2017 22:28:28 +0000 Subject: [PATCH] Use the correct interface for creating an alternative registry source id. --- src/cargo/core/source/source_id.rs | 5 ----- src/cargo/ops/registry.rs | 2 +- 2 files changed, 1 insertion(+), 6 deletions(-) diff --git a/src/cargo/core/source/source_id.rs b/src/cargo/core/source/source_id.rs index e7b430894..4d0ef32c9 100644 --- a/src/cargo/core/source/source_id.rs +++ b/src/cargo/core/source/source_id.rs @@ -150,11 +150,6 @@ impl SourceId { SourceId::new(Kind::Registry, url.clone()) } - /// Create a SourceId from an alternative registry url - pub fn for_alt_registry(url: &Url) -> CargoResult { - SourceId::new(Kind::AltRegistry, url.clone()) - } - /// Create a SourceId from a local registry path pub fn for_local_registry(path: &Path) -> CargoResult { let url = path.to_url()?; diff --git a/src/cargo/ops/registry.rs b/src/cargo/ops/registry.rs index 9b536b21d..4f841d06f 100644 --- a/src/cargo/ops/registry.rs +++ b/src/cargo/ops/registry.rs @@ -243,7 +243,7 @@ pub fn registry(config: &Config, } = registry_configuration(config, registry.clone())?; let token = token.or(token_config); let sid = match (index_config, index, registry) { - (Some(index), _, Some(_registry)) => SourceId::for_alt_registry(&index.to_url()?)?, + (_, _, Some(registry)) => SourceId::alt_registry(config, ®istry)?, (Some(index), _, _) | (None, Some(index), _) => SourceId::for_registry(&index.to_url()?)?, (None, None, _) => SourceId::crates_io(config)?, }; -- 2.30.2